package com.atguigu.springcloud.config;

import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.client.RestTemplate;

/**
 * @Author: 王丹
 * @Date: 2021/3/27 0027 8:52
 * @Description:
 */
@Configuration
public class ApplicationContextConfig {
    @Bean//类似于application.xml <bean id = ''>...
    @LoadBalanced
    public RestTemplate getRestTemplate() {
        return new RestTemplate();
    }
}
